/*
 * sched_clock.h: support for extending counters to full 64-bit ns counter
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef _SCHED_CLOCK_
#define _SCHED_CLOCK_
#include <stdint.h>
#include <stdbool.h>


#define MSEC_PER_SEC    1000L
#define USEC_PER_MSEC   1000L
#define NSEC_PER_USEC   1000L
#define NSEC_PER_MSEC   1000000L
#define USEC_PER_SEC    1000000L
#define NSEC_PER_SEC    1000000000L
#define FSEC_PER_SEC    1000000000000000LL

struct sched_clock_event {
    unsigned long (*read_cyc)(void);
    void (*clock_config)(unsigned long cyc);
    void (*clock_start)(bool one_shot);
    void (*clock_stop)(void);
};
void sched_clock_register(struct sched_clock_event *event_ops, int bits,
                          unsigned long rate);
void update_sched_clock(void);
void sched_clock_init(void);
uint64_t sched_clock(void);
#endif
